<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<style>
			.box{
				width: 600px;
				height: 400px;
				border: 5px solid blue;
			}
			.nav{
				height: 100px;
				
			}
			.nav a{
				display: block;
				width: 200px;
				height: 100px;
				text-align: center;
				line-height: 100px;
				float: left;
			}
			.con{
				height: 300px;
				position: relative;
			}
			.con .list{
				width: 600px;
				height: 300px;
				position: absolute;
				top: 0px;
				left: 0px;
				display: none;
			}
		</style>
		<script type="text/javascript">
			$(function(){
				
				$('.nav a').click(function(){
//					获取当前元素序号0
					var xuhao = $(this).index();
					$('.list').eq(xuhao).fadeIn(1000).siblings().fadeOut(500)
				})
			})
		</script>
	</head>
	<body>
		<div class="box">
			<div class="nav">
				<a href="javascript:;" style="background: red;">红色</a>
				<a href="javascript:;" style="background: yellow;">黄色</a>
				<a href="javascript:;" style="background: green;">绿色</a>
			</div>
			<div class="con">
				<div class="list" style="background: red;display: block;">
					
				</div>
				<div class="list" style="background: yellow;">
					
				</div>
				<div class="list" style="background: green;">
					
				</div>
			</div>
		</div>
	</body>
</html>
